package com.itany.corejava.code06_数组;

import java.util.Arrays;

/**
 * @author 石小俊
 * @date 2023年04月13日 15:55
 */
public class Test11_不定长参数 {

    public static void main(String[] args) {
        test01(1, 1, 3, 5);
        int[] nums = {1, 3, 5};
        System.out.println(Arrays.toString(nums));

        test02("吃饭", "睡觉", "打豆豆");
    }


    public static void test01(int i, int... nums) {
        System.out.println("不定长参数的长度:" + nums.length);
        System.out.println(Arrays.toString(nums));
    }

    public static void test02(String... hobbies) {
        System.out.println(Arrays.toString(hobbies));
    }
}
